﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Threading;

namespace WebServiceClient
{
    class Program
    {
        static double n1 = -1;
        static double n2 = -1;

        static void Main(string[] args)
        {
            //Hamfou.appendPortTypeClient client = new WebServiceClient.Hamfou.appendPortTypeClient();
            //string result = client.append("Hello", "World");
            //Console.WriteLine(result);

            int maxThreadNum, portThreadNum;
            int minThreadNum;

            ThreadPool.GetMaxThreads(out maxThreadNum, out portThreadNum);
            ThreadPool.GetMinThreads(out minThreadNum, out portThreadNum);

            Console.WriteLine(maxThreadNum.ToString());
            Console.WriteLine(minThreadNum.ToString());

            ThreadPool.QueueUserWorkItem(new WaitCallback(TaskProc1), 12);
            ThreadPool.QueueUserWorkItem(new WaitCallback(TaskProc2), 22);


            while(n1 == -1 || n2 == -1);

            Console.WriteLine("n1: " + n1.ToString());
            Console.WriteLine("n2: " + n2.ToString());
        }


        static void TaskProc1(object o)
        {
            n1 = Math.Pow(Convert.ToDouble(o), 8);
        }

        static void TaskProc2(object o)
        {
            n2 = Math.Pow(Convert.ToDouble(o), 4);
        }
    }
}
